-
Notifications
You must be signed in to change notification settings - Fork 1.8k
add typestate pattern chapter for idiomatic rust #2821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.md
Show resolved
Hide resolved
src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @gribozavr suggested, I think both of these slides would benefit from being split in two, where we start with a suboptimal API that allows incorrect usage, then demonstrate how typestate can make incorrect usage impossible.
src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.md
Outdated
Show resolved
Hide resolved
141e680
to
602ef85
Compare
this is again in the flow of a problem statement first, building on our original example, and in next slide we'll add the solution with generics
d727cd7
to
b61c337
Compare
The four slides in the typestate pattern chapter are ready for review again. Note that the generics slide currently exceeds the height limit and fails the corresponding test. I’ve left it as-is for now, since I wasn’t sure how you’d prefer to address that. Let me know how you’d like to proceed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is coming together nicely! I think we still need to break up the generics example since it's too much for a single slide, but the example itself is a good demonstration of typestate.
src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.md
Outdated
Show resolved
Hide resolved
src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.md
Show resolved
Hide resolved
src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-generics.md
Show resolved
Hide resolved
src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-example.md
Show resolved
Hide resolved
src/idiomatic/leveraging-the-type-system/typestate-pattern/typestate-advanced.md
Outdated
Show resolved
Hide resolved
I've removed myself as reviewer as a form of load-shedding, but I looked through this a week or so ago and had no objections, so consider this a soft approval :) |
No description provided.